package com.ylkj.wx.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.stereotype.Repository;

import com.ylkj.common.base.BaseDaoHibernate;
import com.ylkj.wx.dao.OrderInfoDAO;
import com.ylkj.wx.dto.OrderInfoDTO;
import com.ylkj.wx.entitis.OrderEntity;

/**
 * 订单表相关
 * @author baoy
 *
 */
@Repository
public class OrderInfoDAOImpl extends BaseDaoHibernate implements OrderInfoDAO {

	@Override
	public List<OrderInfoDTO> findOrderInfoList(int pageNum, int pageSize) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public OrderInfoDTO fineOneOrderInfoById(int orderId) {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * 保存订单
	 */
	@Override
	public void saveorderInfo(final OrderEntity entityOrder) {
		 getHibernateTemplate().execute(new HibernateCallback<Boolean>() {@Override
		        public Boolean doInHibernate(Session session)
		        		throws HibernateException, SQLException {
		        	session.saveOrUpdate(entityOrder);
		        	return true;
		        }
				});
		
	}

}
